<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:fn="http://java.sun.com/jsp/jstl/functions"
      xmlns:rich="http://richfaces.org/rich">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <div class="tituloPagina">
                <h:graphicImage value="/LaCruz_v2/faces/javax.faces.resource/img/report-icon.png" />
                <h:outputText value="#{bundle.ListPedidoTitle}" style="padding-left: 10px" ></h:outputText>
            </div>
        </ui:define>

        <ui:define name="body">
            <br />
            <br />
            <h:form styleClass="jsfcrud_list_form">
                <h:outputText value="#{pedidoController.clean}" />
                <h:panelGroup id="messagePanel" layout="block">
                    <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                </h:panelGroup>
                <h:outputText escape="false" value="#{bundle.ListPedidoEmpty}" rendered="#{pedidoController.items.rowCount == 0}"/>
                <h:panelGroup rendered="#{pedidoController.items.rowCount > 0}">
                    <rich:dataTable value="#{pedidoController.items}" var="item" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" style="border:solid 0px">
                        <!--<rich:column>
                             <f:facet name="header">
                                 <h:outputText value="#{bundle.ListPedidoTitle_idPedido}"/>
                             </f:facet>
                             <h:outputText value="#{item.idPedido}"/>
                        </rich:column > -->
                        <rich:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListPedidoTitle_usuario}"/>
                            </f:facet>
                            <h:outputText value="#{item[0].nome}"/>
                        </rich:column>
                        <rich:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListPedidoTitle_quantidade}"/>
                            </f:facet>
                            <h:outputText value="#{item[1]}"/>
                        </rich:column>
                        <rich:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListPedidoTitle_total}"/>
                            </f:facet>
                            <h:outputText value="#{item[2]}">
                                <f:convertNumber pattern="R$####.00" />
                            </h:outputText>
                        </rich:column>

                        <rich:column>
                            <f:facet name="header">
                                <h:outputText value="&nbsp;"/>
                            </f:facet>
                            <h:commandLink action="#{pedidoController.prepareView}"  >
                                <h:graphicImage value="#{bundle.ListPedidoViewLink}" title="Ver Relat&oacute;rio" />
                            </h:commandLink>
                        </rich:column>
                    </rich:dataTable>
                </h:panelGroup>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
